# This dockerfile uses the centos image

FROM centos:centos7


MAINTAINER zwpaper <zw.paper@gmail.com>

# update system
RUN yum update -y

# install git and nodejs for hexo
RUN yum -y install git
RUN \
  cd /opt && \
  curl -O http://nodejs.org/dist/v0.10.28/node-v0.10.28-linux-x64.tar.gz && \
  tar -xzf node-v0.10.28-linux-x64.tar.gz && \
  mv node-v0.10.28-linux-x64 node && \
  cd /usr/local/bin && \
  ln -s /opt/node/bin/* . && \
  rm -f /opt/node-v0.10.28-linux-x64.tar.gz

# install hexo and hexo-server
RUN npm install -g hexo-cli
RUN npm install hexo-server --save

# init hexo
RUN \
  hexo init helloworld && \
  cd helloworld && \
  npm install && \
  hexo generate

# start hexo server
RUN \
  cd helloworld && \
  hexo server -p 80 &

